<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="org.wso2.carbon.registry.custom.skb.ui.beans.KBItem" %>
<%@ page import="org.wso2.carbon.registry.custom.skb.ui.utils.GetKBUtil" %>
<%@ page import="org.wso2.carbon.registry.common.utils.RegistryUtil" %>
<%@ page import="org.wso2.carbon.registry.common.ui.UIException" %>
<%
    String cPath = RegistryUtil.getPath(request);
    KBItem kbItem;
    try {
        kbItem = GetKBUtil.getKBItem(cPath, config, session);

        //bean = GetDocumentUtil.getEndpointBean(cPath, config, session);
    } catch (UIException e) {
        %>Error occured while retrieving endpoint details<%
        return;
    }
%>

<br/>

<h3>Problem</h3>

<table width="50%">
    <tr>
    <h1><%=kbItem.getProblemName()%></h1>
    </tr>
    <br/>
    <tr>Issue Link: <a href="<%=kbItem.getLink()%>"><%=kbItem.getLink()%></a></tr>
    <br/>
    <tr>
    <h3>Description</h3>
    <%=kbItem.getDescription()%>
    <br/>
    </tr>
    <br/>
    <tr>
     <h3>Questions</h3>
     <ul>
        <%
          String qn = kbItem.getQuestion();
          String qns[] = qn.split(",");  
          for(int i=0;i<qns.length;i++){
              String name1 = qns[i];
        %>
        <li><%=i+1%>. <%=name1%></li>
        <%
           }
        %>
     </ul>
    </tr>
    <br/>
    <tr>
    <h3>Answers</h3>
     <ul>
        <%
          String an = kbItem.getAnswer();
          String ans[] = an.split(",");
          for(int i=0;i<ans.length;i++){
              String name2 = ans[i];
        %>
        <li><%=i+1%>. <%=name2%></li>
        <%
           }
        %>
     </ul>
    </tr>
    <br/>
    <tr>
    <h3>Solution</h3>
     <ul>
        <%
          String sol = kbItem.getSolution();
          String solns[] = sol.split(",");
          for(int i=0;i<solns.length;i++){
              String name3 = solns[i];
        %>
        <li><%=i+1%>. <%=name3%></li>
        <%
           }
        %>
     </ul>
    </tr>
    <br/>
    <tr>
    <h3>Applies to :</h3>
     <ul>
        <%
          String product = kbItem.getProduct();
          String productR = kbItem.getProductRelease();
        %>
        <li><%=product%> <%=productR%></li>
     </ul>
    </tr>
    <br/>
    <tr>
    <h3>Environment</h3>
     <ul>
        <%
          String jdkP= kbItem.getJDKPlatform();
          String cP = kbItem.getCarbonPlatform();
        %>
        <li>JDK Platform <%=jdkP%></li>
        <li>Carbon Platform <%=cP%></li>
     </ul>
    </tr>
    <br/>
    <tr>
    <h3>Key Words</h3>
     <ul>
        <%
          String keywords= kbItem.getKeyWord();
        %>
        <li><%=keywords%></li>
     </ul>
    </tr>
    <br/>
</table>


<a onclick="loadViewUI('../registry/custom/skb/skb_edit_ajaxprocessor.jsp', '<%=cPath%>')">Edit end point</a>

<br/>
